package chapter3.No3_2_方法join的使用.demo7;

/**
 * Created by Administrator on 2016/11/20.
 */
public class ThreadA extends Thread {
    ThreadB b;

    public ThreadA(ThreadB b) {
        this.b = b;
    }

    @Override
    public void run() {
        synchronized (b) {
            System.out.println("A run begin:"+System.currentTimeMillis());
            try {
                Thread.sleep(3000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("A run end:"+System.currentTimeMillis());
        }
    }
}
